<template>
  <el-form label-width="100px">
    <el-form-item label="专利名称">
      <el-input v-model="selectPatent.name"/>
    </el-form-item>
    <el-form-item label="专利状态">
      <el-select v-model="selectPatent.status" style="width: 100%">
        <el-option label="证书" value="证书"></el-option>
        <el-option label="授权" value="授权"></el-option>
        <el-option label="进入实审" value="进入实审"></el-option>
        <el-option label="受理" value="受理"></el-option>
      </el-select>
    </el-form-item>

    <el-form-item label="专利类型">
      <el-select v-model="selectPatent.type" style="width: 100%">
        <el-option label="发明" value="发明"></el-option>
        <el-option label="实用新型" value="实用新型"></el-option>
        <el-option label="外观结构" value="外观结构"></el-option>
        <el-option label="著作权" value="著作权"></el-option>
      </el-select>
    </el-form-item>

    <el-form-item label="专利内容">
      <el-input v-model="selectPatent.description" :rows="2" type="textarea"/>
    </el-form-item>
    <el-form-item label="专利号">
      <el-input v-model="selectPatent.id" autosize type="textarea"/>
    </el-form-item>
    <el-form-item style="text-align: right">
      <el-button type="primary" @click="patentDialog">修改</el-button>
    </el-form-item>
  </el-form>

</template>

<script>
import {UpdatePatent} from "../../network/patentApi";

export default {
  name: "modifyPatentComponent",
  data() {
    return {}
  },
  methods: {
    patentDialog() {
      UpdatePatent(this.selectPatent).then(res => {
        console.log(res);
        if (res.code === 2000) {
          this.$emit("success");
        }
        if (res.code !== 2000) {
          this.$message({
            message: res.message,
            type: "error"
          })
        }
      })
    },
  },
  mounted() {
    console.log(this.selectPatent);
  },
  props: ["selectPatent"]
}
</script>

<style scoped>

</style>